home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Views
/
Canvas Loops
/
CanvasRowLoop.h
< prev
next >
Wrap
Text File
|
2000-06-23
|
968b
|
41 lines
// CanvasRowLoop.h
#ifndef CanvasRowLoop_h
#define CanvasRowLoop_h
#ifndef CanvasMaintainer_h
#include "CanvasMaintainer.h"
#endif
#ifndef Canvas_h
#include "Canvas.h"
#endif
/*
This object can't screen out invisible rows, because it doesn't
know the row heights, and because you may want to do some work
on invisible rows, like keeping other variables in sync.
*/
class CanvasRowLoop
{
private:
const Canvas& parent;
Range32 row;
Canvas canvas;
CanvasMaintainer canvasMaintainer;
public:
CanvasRowLoop( const Canvas&, Range32 firstRow );
bool Finished() const { return row.Start() >= parent.OffScreen().bottom; }
bool Unfinished() const { return row.Start() < parent.OffScreen().bottom; }
void NextRow( uint32 height );
void Remainder() { NextRow( maxint32 - row.End() ); }
const Canvas *operator->() const { return &canvas; }
const Canvas& operator*() const { return canvas; }
};
#endif